﻿using AdvancedPoll.Models;
using AdvancedPoll.ViewModels;
using Orchard;
using Orchard.ContentManagement;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Web;

namespace AdvancedPoll.Services
{
    [ComVisible(false)]
    public interface IPollService : IDependency
    {
        void CreatePoll(PollPart poll);
        void EditPoll(PollPart part, PollViewModel model);
        void UpdatePoll(PollRecord poll);
        PollRecord GetPoll(int id);
        IContentQuery<PollPart, PollRecord> GetPolls();
        IContentQuery<PollPart, PollRecord> GetPolls(bool isShown);
        void OpenPoll(int id);
        void ClosePoll(int id);
        void DeletePoll(int id);
        void CreateChoice(PollChoiceRecord choice);
        void UpdateChoice(PollChoiceRecord choice);
        void DeleteChoice(PollChoiceRecord choice);
        IQueryable<PollChoiceRecord> GetChoices(int pollId);

        PollResultViewModel GetPollWithResult(int id);
        IQueryable<PollVoteRecord> GetVotes(int pollId);
        bool IsPollClosed(int pollId);
    }
}